<?php

$this->useClass('Filters_protoFilter');
class Filters_LikeString extends Filters_protoFilter {
  protected $fields = array(
    'like_string',
  );
  protected $filterPattern = 'Filters_LikeString_Pattern';
  protected $filterForm = 'Filters_LikeString';
  
  public function testItem( $item ) {
    $string = mb_strtolower("{$item->title} {$item->description}");
    
    if ( false === mb_stripos( $string, $this->data['like_string']) ) {
      return '';
    } else {
      return $this->data['action'];
    }
  }
}